<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<link rel="stylesheet" href="bootstrap/css/bootstrap.css" />
		<link rel="stylesheet" href="css/flat-ui.min.css" />
		<link rel="stylesheet" href="css/Common.css" />

	</head>
	
	<body>	
	<h6><kbd>&nbsp;{$navtype?'修改':'添加'}导航&nbsp;</kbd></h6>
			<ul class="nav nav-tabs mytabs">
				<li class="active"><a href="#userNav" class="url" data-toggle="tab">自定义导航</a></li>
				<li><a href="#cateNav" class="sort"  data-toggle="tab">分类导航</a></li>
				<li><a href="#pageNav" class="page"  data-toggle="tab">页面导航</a></li>
			</ul>
			<div class="tab-content alert alert-info">
		
			<div class="tab-pane fade in active" id="userNav">
				<form action="{:U(MODULE_NAME.'/Navigate/insertAndUpdateHandle')}"  method="post" class="has-success">
							<input type="hidden" value="{$url.id}" name="id" />
			
				<label for="title" ><strong>导航标题</strong></label>
				<input type="text" name="title" value="{$url.title}" id="title" class="form-control" required placeholder="请输入导航标题" />
				<label for="href" ><strong>导航链接</strong></label>
				<input type="text" name="href"  value="{$url.href}"  id="href" class="form-control" required placeholder="请输入导航链接" />
				<label for="target" ><strong>打开方式</strong></label>
				<input type="hidden" name="navtype" value="url">
				<select name="target" id="target" class="form-control select-inverse-dropdown">
					<option value="_self"  >当前窗口打开</option>
					<option value="_blank"  >新窗口打开</option>
				</select>
				<label for="parent" ><strong>父导航</strong></label>
				<select name="parent" id="parent" class="form-control select-inverse-dropdown">
					<option value="0" selected>顶级菜单</option>
					<foreach name="parents" item="p">
						<eq name="p['id']" value="$url.parent">
							<option selected value="{$p['id']}">{$p.title}</option>
							<else />
								<option value="{$p['id']}">{$p.title}</option>
						</eq>
					</foreach>
				
				</select>
				<label for="orders" ><strong>序号（优先级）</strong></label>
				<input type="number" name="orders" id="orders" class="form-control" value="{$url['orders']}" />
				<br />
					<input type="submit" class="btn btn-sm btn-danger" value="{$navtype?'修改':'添加'}" />
					<input type="submit" class="btn btn-sm btn-warning" formaction="{:U(MODULE_NAME.'/Navigate/index')}" formnovalidate value="返 回" />
					</form>
			</div>
			
			<div class="tab-pane fade" id="cateNav">
				<form action="{:U(MODULE_NAME.'/Navigate/insertAndUpdateHandle')}"  method="post" class="has-success">
				<label for="title" ><strong>导航标题</strong></label>
							<input type="hidden" value="{$sort.id}" name="id" />
			
				<input type="text" value="{$sort.title}"  name="title" id="title" class="form-control" required placeholder="请输入导航标题" />
				<label for="params" ><strong>请选择分类</strong></label>
				<select name="params" id="params" class="form-control select-inverse-dropdown">
						<foreach name="sorts" item="s">
						<eq name="s['id']" value="$sort.params">
							<option selected value="{$s['id']}">{$s.name}</option>
							<else />
									<option value="{$s['id']}">{$s.name}</option>
						</eq>
						</foreach>
				</select>
				<label for="target" ><strong>打开方式</strong></label>
				<input type="hidden" name="navtype" value="sort">
				<select name="target" id="target" class="form-control select-inverse-dropdown">
					<option value="_self">当前窗口打开</option>
					<option value="_blank">新窗口打开</option>
				</select>
				<label for="parent" ><strong>父导航</strong></label>
							<select name="parent" id="parent" class="form-control select-inverse-dropdown">
					<option value="0">顶级菜单</option>
					<foreach name="parents" item="p">
						<eq name="p['id']" value="$sort.parent">
							<option selected value="{$p['id']}">{$p.title}</option>
							<else />
								<option value="{$p['id']}">{$p.title}</option>
						</eq>
					</foreach>
				
				</select>
				<label for="orders" ><strong>序号（优先级）</strong></label>
				<input type="number" name="orders" id="orders" class="form-control" value="{$sort['orders']}" />
				<br />
					<input type="submit" class="btn btn-sm btn-danger" value="{$navtype?'修改':'添加'}" />
					<input type="submit" class="btn btn-info" formaction="{:U(MODULE_NAME.'/Navigate/index')}" formnovalidate  value="返 回" />
			</form>
			
			</div>
			
			<div class="tab-pane fade" id="pageNav">
				<form action="{:U(MODULE_NAME.'/Navigate/insertAndUpdateHandle')}"  method="post" class="has-success">
				<label for="title" ><strong>导航标题</strong></label>
				<input type="text" value="{$page.title}" name="title" id="title" class="form-control" placeholder="请输入导航标题" />
				<input type="hidden" value="{$page.id}" name="id" />
				<label for="params" ><strong>请选择文章或页面</strong></label>				
					<select name="params" id="params" class="form-control select-inverse-dropdown">
					<foreach name="pages" item="p">
						<eq name="p['id']" value="$page.params">
							<option selected value="{$p['id']}">{$p.title}</option>		
						<else />
							<option value="{$p['id']}">{$p.title}</option>		
						</eq>			
					</foreach>
				</select>
			<label for="target" ><strong>打开方式</strong></label>
				<input type="hidden" name="navtype" value="page">
				<select name="target" id="target" class="form-control select-inverse-dropdown">
					<option value="_self">当前窗口打开</option>
					<option value="_blank">新窗口打开</option>
				</select>
					<label for="parent" ><strong>父导航</strong></label>
					<select name="parent" id="parent" class="form-control select-inverse-dropdown">
					<option value="0">顶级菜单</option>
					<foreach name="parents" item="p">
							<eq name="p['id']" value="$page.parent">
							<option selected value="{$p['id']}">{$p.title}</option>
							<else />
								<option value="{$p['id']}">{$p.title}</option>
							</eq>
						
					</foreach>
				
				</select>
						<label for="orders" ><strong>序号（优先级）</strong></label>
				<input type="number" name="orders" id="orders" class="form-control" value="{$page['orders']}" />
				<br />
					<input type="submit" class="btn btn-sm btn-danger" value="{$navtype?'修改':'添加'}" />
					<input type="submit" class="btn btn-info  btn-sm " formaction="{:U(MODULE_NAME.'/Navigate/index')}" formnovalidate  value="返 回" />
			</form>
			
			</div>
	</div>
			<script>
				$('.{$navtype}').tab('show');
				
			</script>
	</body>		

</html>
